<template>
  <div class="index-manage sub-margin">
    <!-- <div class="sub-page-title">等次管理</div> -->
    <div class="content" v-if="isAdminRole || isMainRole">
      <div class="search-box">
        <el-menu
          size="small"
          :default-active="activeCode"
          class="search-menu-box"
          mode="horizontal"
          @select="onMenuClick">
          <el-menu-item v-for="(item, key) in menuInfo" :key="key" :index="key">
            {{ item.label }}
          </el-menu-item>
        </el-menu>
      </div>
      <div class="content-con" v-if="activeCode === 'manage'">
        <ManageCon></ManageCon>
      </div>
      <div class="content-con" v-if="activeCode === 'summary'">
        <SummaryCon></SummaryCon>
      </div>
    </div>
    <div class="content" v-if="isOrgRole">
      <OrgManageCon></OrgManageCon>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import ManageCon from './manage'
import SummaryCon from './summary'
import OrgManageCon from './orgManage'

export default {
  name: 'indexManage',
  components: { ManageCon, SummaryCon, OrgManageCon },
  props: {},
  data() {
    return {
      menuInfo: {
        manage: {
          label: '等次管理',
          status: '0',
          queryType: '0',
        },
        summary: {
          label: '等次汇总',
          status: '1',
          queryType: '1',
        },
      },
      activeCode: 'manage',
    }
  },
  watch: {},
  computed: {
    ...mapGetters('role', ['isAdminRole', 'isMainRole', 'isOrgRole']),
  },
  created() {},
  mounted() {},
  methods: {
    onMenuClick(code) {
      this.activeCode = code
    },
  },
}
</script>
<style lang="scss" scoped>
@import '@styles/layout.scss';
.index-manage {
  height: 100%;
  .content {
    // height: calc(100% - 78px);
    height: calc(100%);
    padding-bottom: 5px;
    display: flex;
    flex-direction: column;
    position: relative;
    .search-box {
      width: 100%;
      margin-bottom: 10px;
      .search-menu-box {
        .is-active {
          font-weight: bold;
          font-size: 16px;
        }
      }
    }
    .content-con {
      flex: 1;
      display: flex;
      flex-direction: column;
    }
  }
}
</style>
